package com.tongzhan.base;


import com.tongzhan.annotation.ApplicationName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * @Author: minton.zhang
 * @Date: 2019/5/7 15:23
 */
public abstract class BaseApplication extends SpringBootServletInitializer implements CommandLineRunner {

	@Override
	public void run(String... args) throws Exception {
		Logger log = LoggerFactory.getLogger(this.getClass().getSuperclass());
		ApplicationName annotation = this.getClass().getSuperclass().getAnnotation(ApplicationName.class);
		if (annotation != null) {
			log.info("'{}' 已经启动成功. The '{}' application started successfully.", annotation.value(), log.getName());
		}
	}
}
